<template>
    <el-table :data="list"
              :highlight-current-row="false"
              :header-cell-style="headerStyle"
              @selection-change="selectionChange"
              class="dbTable">
        <el-table-column type="selection"
                         align="center"
                         :selectable="selectable"
                         width="55"
                         v-if="selection">
        </el-table-column>
        <el-table-column v-for="(item, key) in column"
                         :key="key"
                         align="center"
                         :prop="key"
                         :label="item">
        </el-table-column>
        <slot></slot>
    </el-table>
</template>
<script>
export default {
    props: {
        list: Array,
        column: Object,
        selection: Boolean
    },
    data() {
        return {
            dialogVisible: false
        }
    },
    methods: {
        headerStyle() {
            return {
                'text-align': 'center'
            }
        },
        selectionChange(selectVal) {
            this.$emit('getSelectVal', selectVal)
        },
        selectable(row, index) {
            return row.is_mine && row.status === '0'
        }
    }
}
</script>
<style lang='less'>
.dbTable {
    overflow-y: auto;
}
.el-table__header {
    th > .cell > .el-checkbox {
        visibility: hidden;
    }
}
.el-table::before {
    background-color: transparent;
}
</style>
